package com.example.demo;

import org.omg.CORBA.PUBLIC_MEMBER;

public class AdapterDemo {
    public  static void main(String[] args){

        A a=AFactory.createINSTANE();
        a.hai(String.valueOf(1));
    }
    private static class AFactory {
        public static A createINSTANE() {
            return  new A();
        }
    }
    public static class  BAdapte extends A{
        private B b=new B();
        public  String hai(String i){
            return  b.hai(Integer.valueOf(i));
        }
    }
    public  static  class A{
        public String hai(String name){
            return name;
        }
    }
    public  static  class B{
        public String hai(int i){
            return String.valueOf(i);
        }
    }


}
